package com.jic.market.impl.rest.promotion.promotionInfoHandler;

import com.jic.common.base.vo.PageResult;
import com.jic.market.entity.PromotionEntity;
import com.jic.market.request.rest.promotion.PromotionInfoRestRequest;
import com.jic.market.response.rest.promotion.PromotionDetailRestResponse;
import com.jic.market.response.rest.promotion.PromotionGoodsSpuRestResponse;

import java.util.List;
import java.util.function.Function;


/**
 * description: BaseInfoHandler
 * date: 2020/4/8 16:31
 * author: wangys
 * version: 1.0
 */
public interface BaseInfoHandler extends Function<PromotionInfoRestRequest, List<PromotionDetailRestResponse>> {

    public String handlerCode();

    public List<Integer> frontPromTypes();

    /**
     * 启用标志
     * @return
     */
    public boolean enable();

    PromotionDetailRestResponse promotionDetail(PromotionInfoRestRequest request);

    /**
     * 根据thirdProductCode获取活动基本信息列表（最优）
     * @param request
     * @return
     */
    List<PromotionEntity> promotionBaseDetail(PromotionInfoRestRequest request);

    /**
     * 根据promotionCode获取活动详情
     * @param promotionCode
     * @return
     */
    PromotionEntity getPromotionDetailByPromotionCode(String promotionCode);

    /**
     * 根据promotionCode获取参与商品列表（SPU）
     * @param restRequest
     * @param promotionId
     * @return
     */
    PageResult<PromotionGoodsSpuRestResponse> getGoodsByPromotionCode (PromotionInfoRestRequest restRequest, Long promotionId);
}
